#! /bin/sh

DATA=.
n1=501
n2=24
file=$DATA/data
seismic_data_file=$DATA/line
dataheader=$DATA/DemoCDP.su
finaldata=$DATA/datademo.su

#use susynlv to make synthetic data

susynlv nt=$n1 dt=.004 ft=0.0 \
	nxo=$n2 dxo=.0 fxo=0.0 fxs=0. er=0 ob=1 \
	nxs=1 v00=2.0 dvdz=0 dvdx=0 smooth=1 fpeak=25 \
	ref="0.,1.;5.,1." > $file 

suximage < $file  \
	label1="Time (sec)" label2="Distance (km)" \
	title="Raw data " &

#replicate shots
echo "Replicating shot gathers like the one you just saw"
num_of_shots=20
shot=1
dshot=1

>$seismic_data_file

while [ $shot -le $num_of_shots ]
do
	cat $file >> $seismic_data_file 
	shot=`expr $shot + $dshot`
done

#adding headers
echo "Adding" headers, noise and fake statics
sushw < $seismic_data_file key=dt a=4000 |
sushw key=ns a=501 |
sushw key=sx a=0 c=100 j=24 |
sushw key=gx a=0 b=100 j=24 |
suchw key1=gx key2=sx a=200 key3=gx c=1 |
suchw key1=offset key2=gx key3=sx b=1 c=-1 |
suchw key1=cdp key2=gx key3=sx b=1 c=1 d=2 |
suaddnoise f=25,35,40,45 amps=1,1,0,0 |
susort cdp > $dataheader

suaddstatics shift=20 sources=20 \
	 receivers=43 maxfold=20 cmps=62 \
         datafile=$dataheader dt=4 \
         seed=1234 verbose=1 |
sustatic hdrs=1 sign=1 > $finaldata

suximage < $finaldata title="data with statics and noise" &

